package com.example.myapplication.module1.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
import com.example.myapplication.R
import com.example.myapplication.databinding.ItemWorkNoticeBinding
import com.example.myapplication.entity.WorkNoticeBean
import com.example.mylibrary.adapter.BaseRecyclerAdapter

class WorkNoticeAdapter(context: Context) : BaseRecyclerAdapter<ItemWorkNoticeBinding>(context) {
    var workNoticeBeans: MutableList<WorkNoticeBean> = mutableListOf()
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun getViewHolder(baseViewHolder: BaseViewHolder) {

    }

    override fun getBinding(
        inflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): ItemWorkNoticeBinding {
        return ItemWorkNoticeBinding.inflate(inflater,parent,false)
    }

    override fun bindHolder(holder: BaseViewHolder, position: Int) {
        val workNoticeBean = workNoticeBeans[position]
        viewBinding.tvWorkContent.text = workNoticeBean.typeName
        viewBinding.tvNoticeNum.text = workNoticeBean.cont
    }

    override fun getItemCount(): Int {
        return workNoticeBeans.size
    }


}
